package com.aqiang.day0528_shop.user.contract

import com.aqiang.day0528_shop.user.entity.UserEntity
import com.aqiang.lib_core.mvp.BasePresenter
import com.aqiang.lib_core.mvp.IModel
import com.aqiang.lib_core.mvp.IView
import com.zy.shopproject2.usercenter.entity.BaseResponseEntity
import kotlinx.coroutines.Deferred

interface UserContract {
    interface LoginView : IView{
        fun getUser():String
        fun getPwd():String
        fun success(d:Deferred<BaseResponseEntity>)
        fun getAuth():String
        fun successAuth(auth:Deferred<Int>)
    }

    interface RegisterView : IView{
        fun getUser():String
        fun getPwd():String
        fun success(d:Deferred<BaseResponseEntity>)
        fun getAuth():String
        fun successAuth(auth:Deferred<Int>)
    }

    interface LoginModel :IModel{
        fun login(user:String,pwd:String): Deferred<BaseResponseEntity>
        fun authLogin(user:String,pwd:String): Deferred<BaseResponseEntity>
        fun auth():Deferred<Int>
    }

    interface RegisterModel :IModel{
        fun register(user:String,pwd:String): Deferred<BaseResponseEntity>
        fun auth():Deferred<Int>
    }

    abstract class RegisterPresenter(v:RegisterView) : BasePresenter<RegisterModel,RegisterView>(v){
        abstract fun register()
        abstract fun auth()
    }

    abstract class LoginPresenter(v:LoginView) : BasePresenter<LoginModel,LoginView>(v){
        abstract fun login()
        abstract fun authLogin()
        abstract fun auth()
    }
}